﻿#region

using System.Collections.Generic;
using CuongHanh.Context;

#endregion

namespace CuongHanh.Models.View
{
    public class ProductView
    {
        public List<string> Images = new List<string>();

        public ProductView()
        {
        }

        public ProductView(Product model,
                string language)
        {
            Id = model.Id;
            Code = model.Code;
            Name = AppUtil.ProductViewName(model,
                    language);
            Price = model.Price;
            SaleOff = model.SaleOff;
            Image = model.Image;
        }

        public ProductView(int id,
                string code,
                string name,
                long price,
                long saleOff,
                string image,
                string article)
        {
            Id = id;
            Code = code;
            Name = name;
            Price = price;
            SaleOff = saleOff;
            Image = image;
            Article = article;
        }

        public int Id { get; set; }

        public string Code { get; set; }

        public string Name { get; set; }

        public long Price { get; set; }

        public long SaleOff { get; set; }

        public string Image { get; set; }

        public string Article { get; set; }

        public string UrlKey
        {
            get
            {
                return string.Format("{0}-{1}",
                        Name.ToUrlName(),
                        Id);
            }
        }
    }
}
